package net.sareweb.acab.entity.manager;

import java.util.List;

import net.sareweb.acab.entity.Comment;
import net.sareweb.acab.entity.Dialog;
import net.sareweb.acab.entity.Travel;
import net.sareweb.acab.entity.User;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;

@Name("commentManager")
@Scope(ScopeType.CONVERSATION)
public class CommentManager extends CommonManager<Comment> {
	
	
	public List<Comment> getDialogComments(Integer idDialog){
		List<Comment> c = entityManager.createQuery(_GET_DIALOG_COMMENTS)
			.setParameter("idDialog", idDialog).getResultList();
		return c;
	}
	
	private String _GET_DIALOG_COMMENTS ="from Comment where dialog.idDialog=:idDialog order by createDate desc";
	
	
}
